﻿@page "/test"

@using System.Security.Cryptography


密文/明文：
<TextArea @bind-Value=str1 Rows="5" />

密码：
<Input @bind-Value=mima />

密钥长度：
<AntDesign.InputNumber TValue="int" @bind-Value="@mycd" />

加密模式：
<EnumRadioGroup @bind-Value=cipherMode />


填充模式：
<EnumRadioGroup @bind-Value=paddingMode />

<Button OnClick="Jiami">加密</Button>
<Button OnClick="Jiemi">解密</Button>


@code {
    string str1 = "";
    string mima = "";
    int mycd = 256;
    System.Security.Cryptography.CipherMode cipherMode = CipherMode.CBC;
    PaddingMode paddingMode = PaddingMode.PKCS7;

    void Jiami()
    {
        // str1 = str1.AesEncrypt()
        str1 = str1.AesEncrypt(mima);
    }

    void Jiemi()
    {
        str1 = str1.AesDecrypt(mima);

    }


}